import { Injectable } from '@nestjs/common';
import { CreateThemeDto } from './dto/create-theme.dto';
import { UpdateThemeDto } from './dto/update-theme.dto';
import { ThemeRepository } from './theme.repository';
import { User } from '../user/entities/user.entity';
import { Theme } from './entities/theme.entity';
import { ThemeFilterDto } from './dto/themeFilterDto';
import { IPaginationOptions, Pagination } from '../utils/paginate';
import { ThemeBindUserDto } from './dto/bind-user.dto';

@Injectable()
export class ThemeService extends ThemeRepository {
  create(createThemeDto: CreateThemeDto, user: User): Promise<string> {
    return super.createTheme(createThemeDto, user);
  }

  findAll(
    themeFilterDto: ThemeFilterDto,
    user: User,
    options: IPaginationOptions,
  ): Promise<Pagination<Theme>> {
    return super.getThemeList(themeFilterDto, user, options);
  }

  findOne(id: string): Promise<Theme> {
    return super.getThemeById(id);
  }

  update(updateThemeDto: UpdateThemeDto) {
    return super.updateTheme(updateThemeDto);
  }

  remove(id: string): Promise<void> {
    return super.deleteTheme(id);
  }

  bindUser(data: ThemeBindUserDto): Promise<string> {
    return super.bindUsers(data);
  }
}
